<?php


namespace app\admin\controller\setting;


use app\admin\controller\Controller;

use app\store\model\Setting as SettingModel;

class Storage extends Controller
{

    /**
     * 上传设置
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function index()
    {
        if (!$this->request->isAjax()) {
            $vars['values'] = SettingModel::getItem('storage');
            return $this->fetch('index', $vars);
        }
        $model = new SettingModel;
        if ($model->edit('storage', $this->postData('storage'))) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }



}